import request from "@/utils/request";

// 查询资金账户列表
export function listAccount(query) {
  return request({
    url: "/machine/account/list",
    method: "get",
    params: query,
  });
}

// 查询资金账户详细
export function getAccount(id) {
  return request({
    url: "/machine/account/" + id,
    method: "get",
  });
}

// 新增资金账户
export function addAccount(data) {
  return request({
    url: "/machine/account",
    method: "post",
    data: data,
  });
}

// 修改资金账户
export function updateAccount(data) {
  return request({
    url: "/machine/account",
    method: "put",
    data: data,
  });
}

// 删除资金账户
export function delAccount(id) {
  return request({
    url: "/machine/account/" + id,
    method: "delete",
  });
}

// 校验是否可以进行期初设置，有收付款记录，则不允许进行期初设置
export function checkAccountInit(id) {
  return request({
    url: "/machine/account/checkAccountInit/" + id,
    method: "get",
  });
}
